package com.yanmaohu.yulia.bean;

import com.yanmaohu.yulia.statement.SqlSchemaDefinitionStatement;

/**
 * @author Bright Lee
 */
public final class UserDefinedCastDefinition implements SchemaElement, SqlSchemaDefinitionStatement {

    private int beginIndex;
    private int endIndex;
    private DataType sourceDataType;
    private DataType targetDataType;
    private SpecificRoutineDesignator castFunction;

    public UserDefinedCastDefinition(int beginIndex,
                                     int endIndex,
                                     DataType sourceDataType,
                                     DataType targetDataType,
                                     SpecificRoutineDesignator castFunction) {
        this.beginIndex = beginIndex;
        this.endIndex = endIndex;
        this.sourceDataType = sourceDataType;
        this.targetDataType = targetDataType;
        this.castFunction = castFunction;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public DataType getSourceDataType() {
        return sourceDataType;
    }

    public DataType getTargetDataType() {
        return targetDataType;
    }

    public SpecificRoutineDesignator getCastFunction() {
        return castFunction;
    }

}
